<?php
/*
Template Name: Category Landing Page
*/
?>

<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */
 
global $landingpagefeaturedproductsku, $landingpagetopcontent;
$landingpagefeaturedproductsku = get_post_meta($post->ID, 'landingpagefeaturedproductsku', true);

get_header(); ?>

	<div id="primary" class="site-content">
		<div id="content" role="main">
        
        	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
				<header class="entry-header">
					<h1 class="entry-title"><?php the_title(); ?></h1>
                    <?php include 'social-block.php'; ?>
				</header>
                
                <div style="width:50%;float:left;margin:0px;font-size:14px;" class="catlandingtext">
                	<style>
						.catlandingtext .yarpp-related { display:none; }
						.catlandingtext p, .catlandingtext ul li { font-size:14px;line-height:18px; }
					</style>
                	<?php the_field('landingpagetoptext'); ?>
                </div>
                
                <div style="width:45%;float:right;margin:0px;border:#cccccc 1px solid;padding:10px;">
                    <div style="text-align:center;">
                    	<?php include 'page-include-category-landing-page-featured-product.php'; ?>
                    </div>
                </div>
                
                <div style="width:685px;height:0px;clear:both;margin-bottom:10px;"></div>
                
                <?php the_content(); ?>
                
                <div style="width:100%;height:20px;margin:0px;clear:both;"></div>
                
                <?php // Include Sub Pages List If Have Child Pages
					if(post_have_children('$post->ID') == 'true') {
						include 'custom-function-children-of-current-page.php' ;
					} ?>
                
			</article>

		</div><!-- #content -->
        
	</div><!-- #primary -->
    
<?php get_sidebar(); ?>

<?php get_footer(); ?>